package a.f.g.a;

import a.c.d;
import a.c.e;
import a.c.m;
import a.c.n;
import a.c.w;
import a.c.x;
import a.f.o;
import a.f.zc;

import java.util.ArrayList;
import java.util.List;

public class xb
  implements lb
{
  public static final double a = 0.9D;
  protected int b;
  private int c;
  private int d;
  private f e = new pb();
  private f f = new pb();
  private f g = new pb();
  private double h;
  private double j;
  private double k;
  private o l;
  private x m;
  private n o;
  private List p = new ArrayList();
  public static int q;
  public static boolean r;
  
  public xb(o paramo)
  {
    this.l = paramo;
    this.m = paramo.B();
    this.o = paramo.C();
    r();
  }
  
  public void a(dc paramdc)
  {
    this.p.add(paramdc);
  }
  
  public void b(dc paramdc)
  {
    int i = this.p.indexOf(paramdc);
    if (!r)
    {
      if (i < 0) {
        return;
      }
      this.p.remove(i);
    }
  }
  
  void a(cb paramcb, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6)
  {
    boolean bool = r;
    int n = q;
    if (this.p.isEmpty()) {
      return;
    }
    dc.a_ locala_ = new dc.a_(this, paramcb, paramDouble1, paramDouble2, paramDouble3, paramDouble4, paramDouble5, paramDouble6);
    dc[] arrayOfdc = new dc[this.p.size()];
    this.p.toArray(arrayOfdc);
    int i = 0;
    do
    {
      while (n == 0)
      {
        if (i >= arrayOfdc.length) {
          break;
        }
        arrayOfdc[i].a(locala_);
        i++;
      }
    } while (bool);
  }
  
  private void a(o paramo)
  {
    boolean bool = r;
    int i = q;
    w localw = paramo.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      this.m.a(locale, b(locale));
      localw.f();
      if ((!bool) && (i != 0)) {
        return;
      }
    } while (i == 0);
    this.h = (this.c * 0.9D);
    this.j = (0.8100000000000001D * this.c);
    if (!bool) {
      q();
    }
  }
  
  private void b(o paramo)
  {
    int i = q;
    m localm = paramo.w();
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      this.o.a(locald, b(locald));
      localm.f();
    } while (i == 0);
  }
  
  protected void d()
  {
    this.b += 1;
    o();
    n();
  }
  
  private void n()
  {
    boolean bool = r;
    int i = q;
    this.d = this.l.m();
    m localm = this.l.w();
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      Object localObject = (hc)this.o.get(locald);
      if (!bool)
      {
        if (localObject == null)
        {
          localObject = b(locald);
          this.o.a(locald, localObject);
        }
        localm.f();
      }
    } while (i == 0);
  }
  
  private b_ b(d paramd)
  {
    return new b_(paramd);
  }
  
  private void o()
  {
    boolean bool = r;
    int i = q;
    this.c = this.l.k();
    this.h = 0.0D;
    this.j = 0.0D;
    this.f.a();
    this.g.a();
    w localw = this.l.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      a_ locala_ = (a_)this.m.get(locale);
      if (i != 0) {
        return;
      }
      if (!bool) {
        if (locala_ == null)
        {
          locala_ = b(locale);
          this.m.a(locale, locala_);
        }
      }
      double d1 = locala_.g();
      this.h += d1;
      this.j += d1 * d1;
      y localy = locala_.a();
      this.f.a(localy);
      double d2 = localy.d();
      this.g.b(this.g.d() + d2 * d2);
      double d3 = localy.f();
      this.g.d(this.g.f() + d3 * d3);
      double d4 = localy.g();
      this.g.e(this.g.g() + d4 * d4);
      localw.f();
    } while (i == 0);
    if (!bool) {
      q();
    }
  }
  
  protected a_ b(e parame)
  {
    return new a_(parame);
  }
  
  public int l()
  {
    return this.b;
  }
  
  public double j()
  {
    return k.a(this.l.j(), this.h, this.j);
  }
  
  public double f()
  {
    return k.a(this.l.j(), this.f.d(), this.g.d());
  }
  
  public double g()
  {
    return k.a(this.l.j(), this.f.f(), this.g.f());
  }
  
  public double h()
  {
    return k.a(this.l.j(), this.f.g(), this.g.g());
  }
  
  private void q()
  {
    this.k = ((r) || (this.c > 0) ? this.h / this.c : 0.0D);
  }
  
  public y k()
  {
    this.e.b(b());
    this.e.d(c());
    this.e.e(e());
    return this.e;
  }
  
  public double b()
  {
    return (r) || (this.c > 0) ? this.f.d() / this.c : 0.0D;
  }
  
  public double c()
  {
    return (r) || (this.c > 0) ? this.f.f() / this.c : 0.0D;
  }
  
  public double e()
  {
    return (r) || (this.c > 0) ? this.f.g() / this.c : 0.0D;
  }
  
  public cb a(e parame)
  {
    return (cb)this.m.get(parame);
  }
  
  public a_ d(e parame)
  {
    return (a_)this.m.get(parame);
  }
  
  private void r()
  {
    this.d = this.l.m();
    this.c = this.l.k();
    a(this.l);
    b(this.l);
  }
  
  public void s()
  {
    int i = q;
    w localw = this.l.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      a_ locala_ = d(locale);
      zc localzc = this.l.k(locale);
      localzc.a(locala_.b() - localzc.c() / 2.0D, locala_.c() - localzc.d() / 2.0D);
      localw.f();
    } while (i == 0);
  }
  
  int u()
  {
    return this.d;
  }
  
  public o m()
  {
    return this.l;
  }
  
  public double i()
  {
    return this.k;
  }
  
  public int a()
  {
    return this.c;
  }
  
  public double v()
  {
    double d1 = g() * 2.0D;
    double d2 = f() * 2.0D;
    return d1 / d2;
  }
  
  public hc a(d paramd)
  {
    return (hc)this.o.get(paramd);
  }
  
  public b_ c(d paramd)
  {
    return (b_)this.o.get(paramd);
  }
  
  public void c(o paramo)
  {
    if (!r)
    {
      if (paramo != this.l) {
        throw new IllegalStateException();
      }
      paramo.a(this.m);
      this.m = null;
    }
    paramo.a(this.o);
    this.o = null;
    this.l = null;
  }
  
  public class a_
    implements cb
  {
    private f a = new pb();
    private double b;
    private double c;
    private double d = 0.9D;
    private f e = new pb();
    private e f;
    private double g;
    private double h;
    private cb i;
    private static final short j = 0;
    private static final short k = 1;
    private static final short l = 2;
    private static final short m = 3;
    private short n = 0;
    private double o;
    public static boolean p;
    
    a_(e parame)
    {
      this.f = parame;
      i();
    }
    
    public boolean u()
    {
      return this.i != null;
    }
    
    public boolean v()
    {
      if (!xb.r) {}
      return this.n == 3;
    }
    
    public void a(boolean paramBoolean)
    {
      boolean bool = xb.r;
      if (!bool)
      {
        if (paramBoolean)
        {
          if (bool) {
            break label42;
          }
          this.n = ((short)(this.n | 0x2));
        }
      }
      else if (xb.q == 0) {
        return;
      }
      label42:
      this.n = ((short)(this.n & 0xFFFFFFFD));
    }
    
    public void a(cb paramcb)
    {
      this.i = paramcb;
    }
    
    public boolean q()
    {
      if (!xb.r) {}
      return this.n != 0;
    }
    
    public cb r()
    {
      return this.i;
    }
    
    public void b(boolean paramBoolean)
    {
      boolean bool = xb.r;
      if (!bool)
      {
        if (paramBoolean)
        {
          if (bool) {
            break label42;
          }
          this.n = ((short)(this.n | 0x1));
        }
      }
      else if (xb.q == 0) {
        return;
      }
      label42:
      this.n = ((short)(this.n & 0xFFFFFFFE));
    }
    
    public void i()
    {
      zc localzc = xb.this.l.k(this.f);
      a(localzc.c(), localzc.d());
      a(localzc.a() + localzc.c() / 2.0D, localzc.b() + localzc.d() / 2.0D, 0.0D);
    }
    
    public void a(double paramDouble1, double paramDouble2)
    {
      this.b = paramDouble1;
      this.c = paramDouble2;
      k();
    }
    
    private void k()
    {
      this.h = ((this.b + this.c) / 4.0D);
    }
    
    public void w()
    {
      k();
    }
    
    private void b(double paramDouble1, double paramDouble2)
    {
      xb.this.f.b(xb.this.f.d() - paramDouble1 + paramDouble2);
      xb.this.g.b(xb.this.g.d() + (paramDouble2 * paramDouble2 - paramDouble1 * paramDouble1));
    }
    
    private void c(double paramDouble1, double paramDouble2)
    {
      xb.this.f.d(xb.this.f.f() - paramDouble1 + paramDouble2);
      xb.this.g.d(xb.this.g.f() + (paramDouble2 * paramDouble2 - paramDouble1 * paramDouble1));
    }
    
    private void e(double paramDouble1, double paramDouble2)
    {
      xb.this.f.e(xb.this.f.g() - paramDouble1 + paramDouble2);
      xb.this.g.e(xb.this.g.g() + (paramDouble2 * paramDouble2 - paramDouble1 * paramDouble1));
    }
    
    public void a(double paramDouble1, double paramDouble2, double paramDouble3)
    {
      double d1 = this.a.d();
      double d2 = this.a.f();
      double d3 = this.a.g();
      b(this.a.d(), paramDouble1);
      this.a.b(paramDouble1);
      c(this.a.f(), paramDouble2);
      this.a.d(paramDouble2);
      e(this.a.g(), paramDouble3);
      this.a.e(paramDouble3);
      xb.this.a(this, d1, d2, d3, paramDouble1, paramDouble2, paramDouble3);
    }
    
    public void a(y paramy)
    {
      a(paramy.d(), paramy.f(), paramy.g());
    }
    
    public void a(double paramDouble)
    {
      double d1 = this.a.d();
      b(this.a.d(), paramDouble);
      this.a.b(paramDouble);
      xb.this.a(this, d1, this.a.f(), this.a.g(), paramDouble, this.a.f(), this.a.g());
    }
    
    public void c(double paramDouble)
    {
      double d1 = this.a.f();
      c(this.a.f(), paramDouble);
      this.a.d(paramDouble);
      xb.this.a(this, this.a.d(), d1, this.a.g(), this.a.d(), paramDouble, this.a.g());
    }
    
    public void d(double paramDouble)
    {
      double d1 = this.a.g();
      e(this.a.g(), paramDouble);
      this.a.e(paramDouble);
      xb.this.a(this, this.a.d(), this.a.f(), d1, this.a.d(), this.a.f(), paramDouble);
    }
    
    public y a()
    {
      return this.a;
    }
    
    public double b()
    {
      return this.a.d();
    }
    
    public double c()
    {
      return this.a.f();
    }
    
    public double d()
    {
      return this.a.g();
    }
    
    public double e()
    {
      return this.c;
    }
    
    public double f()
    {
      return this.b;
    }
    
    public double g()
    {
      return this.d;
    }
    
    public void e(double paramDouble)
    {
      f(this.d, paramDouble);
      this.d = paramDouble;
    }
    
    private void f(double paramDouble1, double paramDouble2)
    {
      xb.access$318(xb.this, paramDouble2 - paramDouble1);
      xb.access$418(xb.this, paramDouble2 * paramDouble2 - paramDouble1 * paramDouble1);
      xb.this.q();
    }
    
    public void x()
    {
      this.e.a();
    }
    
    public y h()
    {
      return this.e;
    }
    
    public void b(y paramy)
    {
      this.e.a(paramy);
    }
    
    public void c(y paramy)
    {
      a(paramy.d() + this.a.d(), paramy.f() + this.a.f(), paramy.g() + this.a.g());
    }
    
    public void d(y paramy)
    {
      a(paramy.d(), paramy.f(), paramy.g());
    }
    
    public e p()
    {
      return this.f;
    }
    
    public void f(double paramDouble)
    {
      this.g = paramDouble;
    }
    
    public double j()
    {
      return this.g;
    }
    
    public double l()
    {
      return this.h;
    }
    
    public void g(double paramDouble)
    {
      this.o = paramDouble;
    }
    
    public double m()
    {
      return this.o;
    }
    
    public void h(double paramDouble)
    {
      this.h = paramDouble;
    }
    
    public double n()
    {
      return b() - this.b / 2.0D;
    }
    
    public double s()
    {
      return b() + this.b / 2.0D;
    }
    
    public double o()
    {
      return c() - this.c / 2.0D;
    }
    
    public double t()
    {
      return c() + this.c / 2.0D;
    }
    
    f z()
    {
      return this.e;
    }
  }
  
  public class b_
    implements hc
  {
    private double a = 50.0D;
    private d b;
    private xb.a_ d;
    private xb.a_ e;
    private f f = new pb();
    public static int g;
    
    b_(d paramd)
    {
      this.b = paramd;
      this.d = xb.this.d(paramd.e());
      this.e = xb.this.d(paramd.f());
    }
    
    public double a()
    {
      return this.a;
    }
    
    public double b()
    {
      return this.d.l() + this.e.l() + this.a;
    }
    
    public void a(double paramDouble)
    {
      this.a = paramDouble;
    }
    
    public d d()
    {
      return this.b;
    }
    
    public e f()
    {
      return this.b.e();
    }
    
    public e h()
    {
      return this.b.f();
    }
    
    xb.a_ i()
    {
      return this.d;
    }
    
    xb.a_ j()
    {
      return this.e;
    }
    
    public cb c()
    {
      return this.d;
    }
    
    public cb e()
    {
      return this.e;
    }
    
    public double k()
    {
      y localy = this.d.a();
      localy.a(this.e.a(), this.f);
      return Math.abs(this.f.c());
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.g.a.xb

 * JD-Core Version:    0.7.0.1

 */